﻿@model IEnumerable<Bids.Core.DomainObjects.InBox>
@{
    ViewBag.Title = "信息";
    Layout = "~/Views/Designer/_Layout.cshtml";
}
@section head{
    <script type="text/javascript">
        function selectMessage(myid) {
            jQuery.get('/Designer/SelectMessage', { id: myid }, function(data) {
                if (data.length > 0) {
                    var da = art.dialog({
                        title: "站内信",
                        lock: true,
                        content: "<div style='float:left;text-align:left;width: 500px;height: 200px' ><h3>标题: " + data[0].Title + "</h3>" + "</br>内容： " + data[0].Content + "</div>",
                        width: 500,
                        height: 200,
                        ok: function() {
                            da.close();
                        }
                    });
                }

            });
        }

        function delete_message_list() {
            var idlist = select_all();
            if (idlist.length != 0) {
                document.location.href = '/Designer/Message_Delete_List?idlist=' + idlist;
            }
        }

        function Message_update_read(r) {
            var idlist = select_all();
            if (idlist.length != 0) {
                document.location.href = '/Designer/Message_update_read?r=' + r + '&&idlist=' + idlist;
            }
        }
    </script>
}
<div style=" float:left;text-align:left;"></div>
<div class="content">
    <table width="100%" cellspacing="0" border="0" style="border: 1px solid #cdcdcd;" id="ids">
        <tbody>
            <tr>
                <th width="4%" bgcolor="#f1f1f1" style="border-bottom: 1px solid #cdcdcd;"></th>
                <th width="61%" height="50" bgcolor="#f1f1f1" style="border-bottom: 1px solid #cdcdcd;">&nbsp;标 题</th>
                <th width="9%" bgcolor="#f1f1f1" align="center" style="border-bottom: 1px solid #cdcdcd;">阅读状态</th>
                <th width="15%" bgcolor="#f1f1f1" align="center" style="border-bottom: 1px solid #cdcdcd;">时 间</th>
                <th width="14%" bgcolor="#f1f1f1" align="center" style="border-bottom: 1px solid #cdcdcd;">操作</th>
            </tr>
            @foreach (var item in Model)
            {
                <tr bgcolor="#ffffff" class="bo">
                    <td align="center">
                        <input type="checkbox" lang="ids" onclick=" is_check_all(); " value="@item.ID"></td>
                    <td height="20" style="padding: 10px 30px 5px 5px;"><a onclick=" view_message('112709');return false; " class="" id="title_112709" href="#">@item.Title</a></td>
                    <td align="center"><span id="read_text_112709"><span disabled="">@item.InBoxState</span></span></td>
                    <td align="center">@item.CreateTime</td>
                    <td align="center"><a onclick=" view_message('112709');return false; " href="javascript:selectMessage(@item.ID)">查看</a>&nbsp; | <a  href="/Designer/Message_Delete?id=@item.ID">删除</a></td>
                </tr>
            }
        </tbody>
    </table>
    <br>
    <div class="div1">
        <input type="checkbox" onclick="check_all();" id="check_all">
        <input type="button" onclick="Message_update_read(2);" value="设为已读" class="btn">
        <input type="button" onclick="Message_update_read(1);" value="设为未读" class="btn">
        <input type="button" onclick="delete_message_list();" value="批量删除" class="btn">
    </div>

</div>
<script type="text/javascript" language="javascript">
    var massage = "@TempData["Message"]";
    if (massage != null && massage != "") {
        var da = art.dialog({
            lock: true,
            time: 3,
            content: massage,
            icon: 'face-smile',
            ok: function () {
                da.close();
            }
        });
    }
</script>
